using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace ICP_MS.Plugin.iMass;

public class FormPsw : Form
{
	private string user = "";

	private string psw = "";

	private IContainer components = null;

	private Button btnOK;

	private Button btnCancel;

	private Label lblUser;

	private Label lblPsw;

	private Label lblNew;

	private TextBox txtUser;

	private TextBox txtPsw;

	private TextBox txtNew;

	public FormPsw(string user, string psw)
	{
		InitializeComponent();
		this.user = user;
		this.psw = psw;
		txtUser.Text = user;
		txtPsw.Text = psw;
	}

	private void btnOK_Click(object sender, EventArgs e)
	{
		UserManager.Instance.ChangePsw(user, txtNew.Text);
		base.DialogResult = DialogResult.OK;
	}

	private void btnCancel_Click(object sender, EventArgs e)
	{
		base.DialogResult = DialogResult.Cancel;
	}

	private void FormPsw_Load(object sender, EventArgs e)
	{
		Text = Lang.Txt("AddiMass.Text20");
		lblUser.Text = Lang.Txt("AddiMass.Text18");
		lblPsw.Text = Lang.Txt("AddiMass.Text21");
		lblNew.Text = Lang.Txt("AddiMass.Text22");
		btnOK.Text = Lang.Txt("AddiMass.Text14");
		btnCancel.Text = Lang.Txt("AddiMass.Text15");
	}

	protected override void Dispose(bool disposing)
	{
		if (disposing && components != null)
		{
			components.Dispose();
		}
		base.Dispose(disposing);
	}

	private void InitializeComponent()
	{
		System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ICP_MS.Plugin.iMass.FormPsw));
		this.btnOK = new System.Windows.Forms.Button();
		this.btnCancel = new System.Windows.Forms.Button();
		this.lblUser = new System.Windows.Forms.Label();
		this.lblPsw = new System.Windows.Forms.Label();
		this.lblNew = new System.Windows.Forms.Label();
		this.txtUser = new System.Windows.Forms.TextBox();
		this.txtPsw = new System.Windows.Forms.TextBox();
		this.txtNew = new System.Windows.Forms.TextBox();
		base.SuspendLayout();
		this.btnOK.Location = new System.Drawing.Point(64, 185);
		this.btnOK.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
		this.btnOK.Name = "btnOK";
		this.btnOK.Size = new System.Drawing.Size(100, 29);
		this.btnOK.TabIndex = 0;
		this.btnOK.Text = "确定";
		this.btnOK.UseVisualStyleBackColor = true;
		this.btnOK.Click += new System.EventHandler(btnOK_Click);
		this.btnCancel.Location = new System.Drawing.Point(191, 185);
		this.btnCancel.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
		this.btnCancel.Name = "btnCancel";
		this.btnCancel.Size = new System.Drawing.Size(100, 29);
		this.btnCancel.TabIndex = 1;
		this.btnCancel.Text = "取消";
		this.btnCancel.UseVisualStyleBackColor = true;
		this.btnCancel.Click += new System.EventHandler(btnCancel_Click);
		this.lblUser.Location = new System.Drawing.Point(3, 24);
		this.lblUser.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblUser.Name = "lblUser";
		this.lblUser.Size = new System.Drawing.Size(113, 29);
		this.lblUser.TabIndex = 2;
		this.lblUser.Text = "用户名:";
		this.lblUser.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.lblPsw.Location = new System.Drawing.Point(3, 68);
		this.lblPsw.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblPsw.Name = "lblPsw";
		this.lblPsw.Size = new System.Drawing.Size(113, 29);
		this.lblPsw.TabIndex = 3;
		this.lblPsw.Text = "原密码:";
		this.lblPsw.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.lblNew.Location = new System.Drawing.Point(3, 116);
		this.lblNew.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
		this.lblNew.Name = "lblNew";
		this.lblNew.Size = new System.Drawing.Size(113, 29);
		this.lblNew.TabIndex = 4;
		this.lblNew.Text = "新密码:";
		this.lblNew.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
		this.txtUser.Location = new System.Drawing.Point(140, 24);
		this.txtUser.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
		this.txtUser.Name = "txtUser";
		this.txtUser.ReadOnly = true;
		this.txtUser.Size = new System.Drawing.Size(179, 25);
		this.txtUser.TabIndex = 5;
		this.txtUser.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
		this.txtPsw.Location = new System.Drawing.Point(140, 70);
		this.txtPsw.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
		this.txtPsw.Name = "txtPsw";
		this.txtPsw.ReadOnly = true;
		this.txtPsw.Size = new System.Drawing.Size(179, 25);
		this.txtPsw.TabIndex = 6;
		this.txtPsw.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
		this.txtNew.Location = new System.Drawing.Point(140, 119);
		this.txtNew.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
		this.txtNew.Name = "txtNew";
		this.txtNew.Size = new System.Drawing.Size(179, 25);
		this.txtNew.TabIndex = 7;
		this.txtNew.TextAlign = System.Windows.Forms.HorizontalAlignment.Center;
		base.AutoScaleDimensions = new System.Drawing.SizeF(8f, 15f);
		base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
		base.ClientSize = new System.Drawing.Size(336, 229);
		base.Controls.Add(this.txtNew);
		base.Controls.Add(this.txtPsw);
		base.Controls.Add(this.txtUser);
		base.Controls.Add(this.lblNew);
		base.Controls.Add(this.lblPsw);
		base.Controls.Add(this.lblUser);
		base.Controls.Add(this.btnCancel);
		base.Controls.Add(this.btnOK);
		base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D;
		base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
		base.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
		base.MaximizeBox = false;
		base.MinimizeBox = false;
		base.Name = "FormPsw";
		base.ShowIcon = false;
		this.Text = "修改密码";
		base.Load += new System.EventHandler(FormPsw_Load);
		base.ResumeLayout(false);
		base.PerformLayout();
	}
}
